﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Windows.Media.Imaging;
using DOMercury.Interfaces;


namespace Bezel__
{
    class IconValueConverter : IValueConverter
    {
        #region IValueConverter Members

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value != null)
            {
                return (DOMercury.Engine.Interface.EngineCore.GetIconImageWPF(((IItem)(value)).ItemType));
            }
            return DOMercury.Engine.Interface.EngineCore.GetIconImageWPF("default");
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            return "";
        }

        #endregion
    }

    class ActionIconValueConverter : IValueConverter
    {
        #region IValueConverter Members

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value != null)
            {
                return (DOMercury.Engine.Interface.EngineCore.GetIconImageWPF(((IAction)(value)).ActionType));
            }
            return DOMercury.Engine.Interface.EngineCore.GetIconImageWPF("default");
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            return "";
        }

        #endregion
    }

    
}
